
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Quản Lý Khách Hàng</title>
        <link type="text/css" rel="stylesheet" href="css/style.css" />

    </head>
    <body>
         <div id="top-background">
             <div id="page-container">
                 <jsp:include page="template/header.jsp"></jsp:include>
                 <jsp:include page="template/adminpage_menu.jsp"></jsp:include>
                 <div id="main-content">
                     <div style="padding: 10px;">
                          <h2 style="color:#0099ff;">Bộ lọc</h2><br>
                         <s:form action="QLKhachHang" method="POST" cssStyle="padding:0px 10px 10px 0px;" theme="simple">
                             <table>
                                 <tr>
                                     <td>
                                         <h4 style="color:#0099ff;">Tìm kiếm theo</h4>
                                     </td>
                                     <td>
                                         <s:select list="#{'1':'MãKH','2':'TênKH','3':'Tất cả'}" name="chon"></s:select>
                                     </td>
                                 </tr>
                                  <tr>
                                     <td>
                                         <h4 style="color:#0099ff;">Giá trị tìm kiếm </h4>
                                     </td>
                                     <td>
                                          <s:textfield name="gtTimKiem" ></s:textfield>
                                     </td>
                                 </tr>
                                 <tr>
                                      <td>

                                     </td>
                                    <td>
                                        <s:submit name="btnTimKiem" value="Tìm kiếm"></s:submit>
                                     </td>
                                    
                                 </tr>
                                 <tr>
                                     <td colspan="2">
                                         <s:actionerror cssStyle="color:red;" />
                                     </td>
                                 </tr>
                             </table>
                         </s:form>
                     </div>
                     <div style="padding: 10px;">
                         <table width="100%;" border="1" id="khachhang">
                             <tr style="background-color: #000; color: white;">
                                     <th>Tên đăng nhập</th>
                                     <th>Mật khẩu</th>
                                     <th>Họ tên</th>
                                     <th>Giới tính</th>
                                     <th>Địa chỉ</th>
                                     <th>Email</th>
                                     <th>Số điện thoại</th>
                                     <th>Là Admin</th>
                                 </tr>
                                 <tbody>

                                     <s:iterator value="dskh" status="dskhStatus">
                                         <s:form action="CapNhatKH.action?MaKH=%{MaKH}" method="POST" theme="simple">
                                         <tr>
                                             <td>
                                                 <s:property value="TenDangNhap" />
                                             </td>
                                             <td>
                                                 <s:textfield name = "MatKhau" value="%{Matkhau}" theme="simple" cssStyle="width:80px;"></s:textfield>
                                             </td>
                                             <td>
                                                 <s:textfield name = "HoTen" value="%{HoTen}" theme="simple" cssStyle="width:80px;"></s:textfield>
                                             </td>
                                             <td>
                                                 <s:select list="#{'1':'Nam','0':'Nữ'}" name="GioiTinh" value="%{GioiTinh}" theme="simple"></s:select>
                                             </td>
                                             <td>
                                                 <s:textfield name = "DiaChi" value="%{DiaChi}" theme="simple" cssStyle="width:80px;"></s:textfield>
                                             </td>
                                             <td>
                                                 <s:textfield name = "Email" value="%{Email}" theme="simple" cssStyle="width:80px;"></s:textfield>
                                             </td>
                                              <td>
                                                 <s:textfield name = "DienThoai" value="%{DienThoai}" theme="simple" cssStyle="width:80px;"></s:textfield>
                                             </td>
                                              <td>
                                                  <s:select list="#{'1':'Có','0':'Không'}" name="QuyenHan" value="%{QuyenHan}" theme="simple"></s:select>
                                             </td>
                                             <s:url id = "xoa" action="XoaKhachHang">
                                                 <s:param name = "GiaTriTim" value="MaKH"></s:param>
                                                 <s:param name = "gtTimKiem" value="gtTimKiem"></s:param>
                                                 <s:param name = "chon" value="chon"></s:param>
                                             </s:url>
                                             <td style="width:80px;">
                                                 <s:a href="%{xoa}"><img width="40px;" height="40px;" alt="Xóa" title="Xóa" src="images/delete.png" /></s:a>
                                             </td>
                                             <td>
                                                 <s:hidden name = "chon" value="%{chon}"></s:hidden>
                                                 <s:hidden name = "gtTimKiem" value="%{gtTimKiem}"></s:hidden>
                                                 <s:submit name="btnCapNhat" value="Cập nhật" theme="simple"></s:submit>
                                             </td>
                                         </tr>
                                          </s:form>
                                     </s:iterator>

                                 </tbody>
                             </table>
                     </div>
                 </div>
                 <div style="clear: both;"></div>
                 <jsp:include page="template/footer.jsp"></jsp:include>
             </div>
        </div>
    </body>
</html>
